<template>
  <div style="text-align:center" width="710">
    <table style="margin-left: auto; margin-right: auto;text-align:center" id='programme' width="710">
      <tbody>
        <tr style="height: 34px;">
          <td style="height: 34px;" colspan="8">
            <p style="text-align: center;font-size:32px;margin-top:20px">
              <strong>{{jkdn.jddw}}生化检查体检报告单</strong>
            </p>
          </td>
        </tr>
        <tr style="height: 50px;">
          <td style="height: 50px;border-bottom:2px solid black;" colspan="8">
            <p style="font-size:17px">
              编号:{{tmcode}} 姓名:{{jkdn.name}} 性别:{{sex==1?'男':'女'}} 身份证号:{{jkdn.sfzhm}} 电话:{{jkdn.lxdh}} </p>
          </td>
        </tr>
        <tr style="height: 34px;border-bottom:2px solid black;">
          <td style="height: 34px;" width="200">
            <p>项目名称</p>
          </td>
          <td style="height: 34px;" width="171">
            <p>结果数值</p>
          </td>
          <td style="height: 34px;" width="104">
            <p>提示</p>
          </td>
          <td style="height: 34px;" width="89">
            <p>单位</p>
          </td>
          <td style="height: 34px;" width="183">
            <p>参考范围</p>
          </td>
        </tr>
        <tr style="height: 34px;" v-for="(d) in data" :key="d.id">

          <td style="height: 34px;" width="200">
            <p>{{d.jktjxmmc}}</p>
          </td>
          <td style="height: 34px;" width="171">
            <p>{{d.jktjjgsz}}</p>
          </td>
          <td style="height: 34px; " width="104">
            <p>{{d.jktjts}}</p>
          </td>
          <td style="height: 34px;" width="89">
            <p>{{d.jktjdw}}</p>
          </td>
          <td style="height: 34px; " width="173">
            <p>{{d.jktjckfw}}</p>
          </td>
        </tr>
        <tr style="height: 53px; ">
          <td style="height: 53px; border-top:1.5px solid black; text-align: justify; " colspan="8 " width="710 ">
            <p>体检时间：{{jkdn.jdrq}}&nbsp;&nbsp; 检验人员：{{jgxx.hyry}}&nbsp;检验科&nbsp;&nbsp;村:{{jkdn.jddw}}
              <i style="display:inline-block; padding-left: 88%; width:100%; "></i>
            </p>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</template>
<script>
import { getObj } from '@/api/cust/health/shct'
import html2canvas from 'html2canvas'
import { getStore } from '@/util/store.js'
export default {
  name: 'xcgct',
  data() {
    return {
      grjbxxid: '',
      jktjid: '',
      sfzh: '',
      data: [],
      jkdn: '',
      tjsj: '',
      tmcode: '',
      sex: '',
      jgxx: ''
    }
  },
  created() {
    this.jgxx = getStore({ name: 'org' })
    this.jkdn = getStore({ name: 'jkdn' })
    this.sex = parseInt(this.jkdn.sfzhm.substr(16, 1)) % 2
    this.grjbxxid = this.$route.query.grjbxxid
    this.jktjid = this.$route.query.id
    this.sfzh = this.$route.query.sfzh
    this.tmcode = this.$route.query.tmcode
    this.getObj()
  },
  mounted() {},
  methods: {
    getObj() {
      getObj({
        jktjid: this.jktjid,
        grjbxxid: this.grjbxxid,
        jktjsfzh: this.sfzh
      }).then(res => {
        this.data = res.data.data
        if (!this.validatenull(this.data)) {
          // var newd = new Date(this.data[0].jktjtjsj + 'GMT+0800')
          this.tjsj = this.data[0].jktjtjsj
        }
      })
    }
  },
  computed: {},
  props: []
}
</script>